package com.smart.community.feign.parking;

import com.smart.community.feign.parking.fallback.ParkingStatisticsFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 停车统计Feign接口
 * 提供停车位数量统计相关的远程调用接口
 * 
 * @author Wu.Liang
 * @version 1.0.0
 * @since 2025-01-30
 */
@FeignClient(
    name = "smart-community-parking",
    path = "/feign/parking",
    fallbackFactory = ParkingStatisticsFeignFallbackFactory.class,
    contextId = "parkingStatisticsFeign"
)
public interface IParkingStatisticsFeign {
    
    /**
     * 根据社区ID列表统计停车位数量
     * 
     * @param communityIds 社区ID列表
     * @return 停车位数量
     */
    @PostMapping("/statistics/parking-space-count/by-communities")
    Long countParkingSpacesByCommunityIds(@RequestBody List<Long> communityIds);
    
    /**
     * 根据物业公司ID列表统计停车位数量
     * 
     * @param propertyCompanyIds 物业公司ID列表
     * @return 停车位数量
     */
    @PostMapping("/statistics/parking-space-count/by-property-companies")
    Long countParkingSpacesByPropertyCompanyIds(@RequestBody List<Long> propertyCompanyIds);
}
